cmake_minimum_required(VERSION "3.10")
project("test")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED On)

# 参考：https://www.jianshu.com/p/63610b53af18
# https://github.com/google/googletest/releases/tag/v1.17.0 下载 googletest-1.17.0.tar.gz
# tar -zxvf googletest-1.17.0.tar.gz
ADD_SUBDIRECTORY("googletest-1.17.0") # 生成并导出gtest等库。默认静态库

add_executable("testAllLoadBalancePolicy" "./testAllLoadBalancePolicy.cpp")
target_include_directories("testAllLoadBalancePolicy" PRIVATE
    ${CMAKE_SOURCE_DIR}/../../loadBalance/code # CMakeLists.txt目录/../../loadBalance/code
    ${gtest_SOURCE_DIR}/include # googletest-1.17.0/googletest/include
    ${gmock_SOURCE_DIR}/include # googletest-1.17.0/googletest/include
)
target_link_libraries("testAllLoadBalancePolicy" gtest) # 链接了gmock等